package com.itheima.service.impl;

import com.itheima.mapper.SysRoleMenuMapper;
import com.itheima.service.SysRoleMenuService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class SysRoleMenuServiceImpl implements SysRoleMenuService {

    private final SysRoleMenuMapper sysRoleMenuMapper;

    @Override
    public void insertRoleMenu(String id, List<Integer> menuids) {
        sysRoleMenuMapper.insertRoleMenu(id,menuids);
    }

    @Override
    public void deleteRoleMenuByRoleId(String roleId) {
        sysRoleMenuMapper.deleteRoleByRoleId(roleId);
    }

    @Override
    public List<Integer> selectRoleMenuByRoleId(String roleId) {
        List<Integer> menuIds = sysRoleMenuMapper.selectRoleMenuByRoleId(roleId);
        return menuIds;
    }
}
